package com.bw.lyc.mvp.view.people.adapter;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.bw.lyc.mvp.view.people.FollowFragment;
import com.bw.lyc.mvp.view.people.RecommendFragment;

public class PeopleVpAdapter extends FragmentPagerAdapter {

    private List<Fragment> list = new ArrayList<>();
    private String[]titles = {"推荐","关注"};

    public PeopleVpAdapter(@NonNull FragmentManager fm) {
        super(fm);
        list.add(new RecommendFragment());
        list.add(new FollowFragment());
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
